import {defineStore} from "pinia";

export let defineUser = defineStore('loginUser', {
    state: () => {
        return {
            uid: 0,
            username: '张三'
        }
    },
    actions: {
        // 设置用户信息的方法
        setUser(userInfo) {
            this.uid = userInfo.uid
            this.username = userInfo.username
        },
        // 清除用户信息
        clearUser() {
            this.uid = null
            this.username = null
        }
    },
    getters: {}
})